package com.imut.service.impl;

import com.imut.entity.NovelChapter;
import com.imut.mapper.NovelChapterMapper;

import com.imut.service.NovelChapterServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author jiangYaPeng
 * @Date 2025-07-08 17:08
 */
@Service
public class NovelChapterServiceImpl implements NovelChapterServices {

    @Autowired
    private NovelChapterMapper novelChapterMapper;


    @Override
    public List<NovelChapter> selectById(Long id) {
        return novelChapterMapper.selectById(id);
    }

    @Override
    public NovelChapter selectByChapterId(Long id) {
        return novelChapterMapper.selectByChapterId(id);
    }

    @Override
    public Boolean insert(NovelChapter novelChapter) {
        int insert = novelChapterMapper.insert(novelChapter);
        return insert != 0;
    }

    @Override
    public Boolean update(NovelChapter novelChapter) {
        int update = novelChapterMapper.update(novelChapter);
        return update != 0;


    }

    @Override
    public Boolean delete(Long id) {
        int delete = novelChapterMapper.delete(id);
        return delete != 0;
    }
}
